<!DOCTYPE html>
<html>
<head>
    <title>属性管理</title>
	 <#include "/common/import.ftl" >
    <script type="text/javascript">
        $(function () {
            $('#unitSaveForm').form({
                onSubmit: function () {
                    return $(this).form('validate');
                },
                success: function (data) {
                    var result = jQuery.parseJSON(data);
                    if (result.flag == 'T') {
                        $.messager.alert('提交结果', '操作成功!', 'info', function () {
                            parent.closeAdd();
                            parent.reload();
                        });
                    } else {
                        $.messager.alert('提交结果', result.msg, 'error');
                    }
                }
            });
        });
    </script>

<body>

<form id="unitSaveForm" name="unitSaveForm" method="post" action="save.action">
    <input type="hidden" name="formToken" id="formToken" value="${formToken!''}"/>
    <input type="hidden" name="detailId" id="detailId" value="${item.detailId!''}"/>
    <input type="hidden" name="modelId" id="modelId" value="${item.modelId!''}"/>
    <table class="datagrid-body">
        <tr>
            <td class="datagrid-header">属性标识<font color="red">*</font></td>
            <td>
                <input id="columnEname" name="columnEname" value="${item.columnEname!''}"
                <#if item.columnEname??> readonly="readonly"</#if>
                       class="easyui-validatebox"
                       data-options="required:true,validType:'length[2,30]'"
                       size="30" "
                missingMessage="请输入字符串作为标识" invalidMessage="应为2~30个字" />
            </td>
        </tr>
        <tr>
            <td class="datagrid-header">属性名称<font color="red">*</font></td>
            <td>
                <input name="columnCname" id="columnCname" value="${item.columnCname!''}"
                       class="easyui-validatebox"
                       data-options="required:true,validType:'length[2,30]'" size="30"
                       missingMessage="请输入名称" invalidMessage="应为2~30个字"/>
            </td>
        </tr>
        <tr>
            <td class="datagrid-header">是否主键</td>
            <td>
                <input type="radio" name="primaryKey" id="primaryKey_1" value="1"/>是
                <input type="radio" name="primaryKey" id="primaryKey_0" checked="checked"
                       value="0"/>否
            </td>
        </tr>
        <tr>
            <td class="datagrid-header"></td>
            <td>
                <a href="#" class="easyui-linkbutton" iconCls="icon-save"
                   onclick="$('#unitSaveForm').submit();">提交</a>
                <a href="#" class="easyui-linkbutton" iconCls="icon-cancel"
                   onclick="parent.closeAdd();" ;>取消</a>
            </td>
        </tr>

    </table>

</form>
</body>
<script type="text/javascript" src="${ctx}/js/utiltools.js"></script>
<script>
    $(function () {
        UtilTools.initRadio("primaryKey", "${item.primaryKey!''}");
    });
</script>
</html>